package expresiones;

public class Pila {

	
	private void Imprimir(Object[] vector,int tope) {
		for(int i=0;i<tope;i++){
			System.out.print("\n"+vector[i]+"|");
		}		
	}
	private int Apilar(Object[] vector,int tope,Object dato){
		if(!Llena(vector,tope)){
			vector[tope]=dato;
			tope++;	
		}
		
		return tope;
	}	
	private int Desapilar(Object[] vector,int tope){
		if(!Vacia(vector,tope))
			tope--;		
		
		return tope;
	}
	private Object ElementoTope(Object[] vector,int tope){
		return vector[tope-1];
	}
	private boolean Vacia(Object[] vector,int tope){
		if(tope==0)
			return true;
			else
				return false;

	}
	private boolean Llena(Object[] vector,int tope){
		if(tope>=vector.length)
			return true;
			else
				return false;
	}

}
